﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Caliburn.Micro;

namespace SunXmlEditor.Views
{
  public class AddNameViewModel : Screen
  {
    public AddNameViewModel()
    {
      DisplayName = "添加新项";
    }

    private string _XName;

    /// <summary>
    /// 绑定通知，特姓名
    /// </summary>
    public string XName
    {
      get { return _XName; }
      set
      {
        if (_XName == value) { return; }
        _XName = value;
        NotifyOfPropertyChange(nameof(XName));
      }
    }
    public void Submit()
    {
      if (!String.IsNullOrWhiteSpace(XName))
      {
        TryClose(true);
      }
    }
  }
}
